package mongodb

import (
	"time"

	"github.com/jinzhu/now"
)

// 生成当前日期前的 tag
func generate_static_time_tag() (timetags []time.Time) {
	nowt := time.Now()
	for year := 2001; year <= nowt.Year(); year++ {
		// for _, month := range []int{3, 6, 9, 12} {
		for _, month := range []int{12} {
			tt := time.Date(year, time.Month(month), 11, 0, 0, 0, 0, time.Local)
			tt = now.With(tt).EndOfMonth()
			if nowt.Sub(tt) > 0 {
				timetags = append(timetags, tt)
			}
		}
	}
	return
}

func time_format(t time.Time) string {
	return t.Format("2006-01-02")
}
